package com.lgx.mobile.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lgx.common.exception.DataException;
import com.lgx.mobile.dao.IGiftDao;
import com.lgx.mobile.entity.Gift;
import com.lgx.mobile.service.IGiftService;

/**
 * 礼物Service
 * 
 * @author xuyichen
 *
 */
@Service("giftService")
public class GiftService implements IGiftService {

	@Autowired
	private IGiftDao giftDao;
	
	public IGiftDao getGiftDao() {
		return giftDao;
	}

	public void setGiftDao(IGiftDao giftDao) {
		this.giftDao = giftDao;
	}

	@Transactional
	public Gift createGift(Gift gift) throws DataException {
		return this.giftDao.createGift(gift);
	}

	@Transactional
	public Gift updateGift(Gift gift) throws DataException {
		return this.giftDao.updateGift(gift);
	}

	@Transactional
	public void deleteGift(Gift gift) throws DataException {
		this.giftDao.deleteGift(gift);
	}

	@Transactional
	public void deleteGiftById(long id) throws DataException {
		this.giftDao.deleteGiftById(id);
	}

	public Gift findGiftById(long id) {
		return this.giftDao.findGiftById(id);
	}

	public List<Gift> findGiftList() {
		return this.giftDao.findGiftList();
	}
}
